package io.fivefire.base.common.enums;

import java.util.List;

/**
 * 图片位置
 */
public enum PositionEnum implements IndexedEnum {
    ART(1, "art"),
    TEMP(2, "temp"),;

    private int code;
    private String desc;

    PositionEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    private static final List<PositionEnum> INDEXES = IndexedEnumUtil.toIndexes(PositionEnum.values());

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getName() {
        return desc;
    }

    public String getDesc() {
        return desc;
    }
    public static PositionEnum codeOf(final int code) {
        return IndexedEnumUtil.valueOf(INDEXES, code);
    }

}
